<template>
  <div>

    <myheader></myheader>

			<br><br>

            <!-- 面包屑导航 -->
            <Breadcrumb :datas='datas'></Breadcrumb>

	<section class="featured-block text-center">
		<div class="container">


            <table>

                <tr>
                    <td style="padding:5px">
                        密码：
                    </td>
                    <td style="padding:5px">
                        <input type="password" v-model='password'>
                    </td>

                <tr>
                    <td style="padding:5px">
                        确认密码：
                    </td>
                    <td style="padding:5px">
                        <input type="password" v-model='password1'>
                    </td>

                </tr>

                <tr>
                    <td style="padding:5px">

                    </td>
                    <td style="padding:5px">
                        <Button @click="submit">提交</Button>
                    </td>

                </tr>

            </table>

            <br /><br />

    </div>
	</section>


  </div>

</template>



<script>

//导包
import myheader from './myheader.vue';


export default {
  data () {
    return {

      msg: "这是一个变量",
      //声明面包屑变量
      datas:[{title:'首页',route:{name:'index'}},{title:'我的首页'}],
      password:'',
      password1:'',

    }
  },
  //注册组件标签
  components:{
      'myheader':myheader,
  },

  mounted:function(){



},
  methods:{




    //提交
    submit(){
          if (this.password === '') {
            this.$Message('密码不能为为空')
            return false
          }
          if (this.password1 === '') {
            this.$Message('密码不能为为空')
            return false
          }
          if (this.password !== this.password1) {
            this.$Message('两次密码不一致')
            return false
          }
          this.axios.get('http://127.0.0.1:8000/updatepass/',{params:{uid:localStorage.getItem('uid'),password:this.password}}).then(res=>{
              if(res.data.code == 200){
                  alert('修改成功')
                  this.$router.push('/')
              }else{
                  this.$Message(res.data.data);
              }
          })
    },


    }
}


</script>

<style>



</style>
